package com.sentinel.server;

import com.alibaba.csp.sentinel.cluster.server.ClusterTokenServer;
import com.alibaba.csp.sentinel.cluster.server.SentinelDefaultTokenServer;
import com.alibaba.csp.sentinel.cluster.server.config.ClusterServerConfigManager;
import com.alibaba.csp.sentinel.cluster.server.config.ServerTransportConfig;

import java.util.Collections;

public class TokenServerApplication {

    public static void main(String[] args) throws Exception {
        // SpringApplication.run(TokenServerApplication.class, args);
        ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();
        //传输配置
        ClusterServerConfigManager.loadGlobalTransportConfig(new ServerTransportConfig()
                .setIdleSeconds(600).setPort(8811));
        ClusterServerConfigManager.loadServerNamespaceSet(Collections.singleton("sentinel-server-01"));
        tokenServer.start();
    }
}